<?php

namespace App\Http\Middleware;

use Closure;

class Test
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next,$test = '')
    {
        echo ' 前置<br>';
        $response =  $next($request);//业务逻辑应用代码（比如控制器的方法）
        echo '后置:'.$test.'<br>';
        return $response;
    }
}
